<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>

    <div id="app">
        <!-- 
            表单域修饰符
                - number : 转化为数值
                - trim : 去掉开始和结尾的内容
                - lazy : 将input时间转换为change事件
            <input v-model.number="age" type="number" />
         -->
        <div><input type="text" v-model.number='age' ></div>
        <div><input type="text" v-model.trim='info'></div>
        <!-- 这里失去焦点的时候,才会在下面进行显示,应用场景:用户名存在校验等 -->
        <div><input type="text" v-model.lazy='msg'></div>
        <div>{{msg}}</div>
        <button @click="handle">点击</button>
    </div>

    <script lang="text/javascript">
        var vm = new Vue({
            el: "#app",
            data: {
                age:'',
                info:'',
                msg:''
            },
            methods: {
                handle: function () {
                    // console.log(this.age + 10)
                    // console.log(this.info)
                }
            }
        })
    </script>

</body>

</html>